public class Solution {
    public int[] twoSum(int[] nums, int target) {
        int a=0;int b=1;
        for(int i=0;i<nums.length-1;i++){

            for(int j=1;j<nums.length;j++){
                if(i==j)j++;
                if(nums[i]+nums[j]==target){
                    a=i;b=j;break;
                }
            }

        }
        int[]abb=new int[2];
        abb[0]=a;abb[1]=b;
        return abb;
    }

    public static void main(String[] args) {
        Solution solution=new Solution();
        int []nums={2,7,11,15};
        int target=9;
        int[] result=solution.twoSum(nums,target);
        if(result.length==2&&result[0]==0&&result[1]==1){
            System.out.println("testcase1 ok");
        }else {
            System.out.println("testcase1 failed");
        }
    }
}
